<%--
  Created by IntelliJ IDEA.
  User: 陈俊雄
  Date: 2018/5/25
  Time: 9:37
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<div class="modal-header">
    <button class="close" ng-click="cancel()">
        <span aria-hidden="true">×</span>
    </button>
    <h3 class="modal-title" id="modal-title">{{ type == 0 ? '添加域名' : '编辑信息'}}</h3>
</div>
<div class="modal-body" id="modal-body">
    <div class="ibox-content no-borders tab-content">
        <form name="myForm" class="form-horizontal">
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs"><span class="text-danger">*</span>关联商户：</label>
                <div class="col-sm-10">
                    <select class="form-control b-r-sm" name="status" ng-model="webSiteInfo.merId"
                            ng-blur="merIdBlur($event, webSiteInfo.merId)" required>
                        <option disabled style='display:none;' value=""></option>
                        <option ng-repeat="x in merchantInfo" value="{{x.id}}">{{x.name}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs"><span class="text-danger">*</span>商户域名：</label>
                <div class="col-sm-10">
                    <input class="form-control b-r-sm" type="text" name="siteUrl" placeholder="必填"
                           ng-model="webSiteInfo.siteUrl" ng-blur="siteUrlBlur($event, webSiteInfo.siteUrl)"
                           required>
                </div>
            </div>
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs"><span class="text-danger">*</span>状态：</label>
                <div class="col-sm-10">
                    <select class="form-control b-r-sm" name="status" ng-model="webSiteInfo.status"
                            ng-blur="statusBlur($event, webSiteInfo.status)"
                            ng-options="+(x.firstValue) as x.name for x in webSiteStatus" required>
                    </select>
                </div>
            </div>
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs"><span class="text-danger">*</span>行业类型：</label>
                <div class="col-sm-10">
                    <select class="form-control b-r-sm" name="industryId" ng-model="webSiteInfo.industryId"
                            ng-blur="industryIdBlur($event, webSiteInfo.industryId)"
                            ng-options="x.firstValue as x.name for x in industryType" required>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label p-w-xs"><span class="text-danger">*</span>产品类型：</label>
                <div class="col-sm-10">
                    <select class="form-control b-r-sm" name="industryId" ng-model="webSiteInfo.productTypeId"
                            ng-blur="productTypeIdBlur($event, webSiteInfo.productTypeId)"
                            ng-options="x.productTypeId as x.productTypeName for x in merchantWebsiteProType" required>
                    </select>
                </div>
            </div>
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs">结算周期（天）：</label>
                <div class="col-sm-10">
                    <input class="form-control b-r-sm" type="number" name="settleCycle"
                           ng-model="webSiteInfo.settleCycle">
                </div>
            </div>
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs">月结算日：</label>
                <div class="col-sm-10">
                    <input class="form-control b-r-sm" type="text" name="settleCycle" placeholder="可多填；以，分隔"
                           ng-model="webSiteInfo.settleDay">
                </div>
            </div>
            <div class="form-group" ng-show="type != 2">
                <label class="col-sm-2 control-label p-w-xs">备注：</label>
                <div class="col-sm-10">
                    <input class="form-control b-r-sm" type="text" name="remark"
                           ng-model="webSiteInfo.remark">
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="center">
                <button class="btn btn-sm btn-primary" type="button" ng-click="confirm(webSiteInfo)"
                        ng-disabled="myForm.$error.required || siteUrlExist">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>